﻿using System;
using System.Collections.Generic;
using System.Web;

namespace Amf4Asmx.Web.Handlers
{
    internal class HandlerWrapper : IHttpHandler
    {
        // Fields
        private IHttpHandlerFactory _originalFactory;
        protected IHttpHandler _originalHandler;

        // Methods
        internal HandlerWrapper(IHttpHandler originalHandler, IHttpHandlerFactory originalFactory)
        {
            this._originalFactory = originalFactory;
            this._originalHandler = originalHandler;
        }

        public void ProcessRequest(HttpContext context)
        {
            this._originalHandler.ProcessRequest(context);
        }

        internal void ReleaseHandler()
        {
            this._originalFactory.ReleaseHandler(this._originalHandler);
        }

        // Properties
        public bool IsReusable
        {
            get
            {
                return this._originalHandler.IsReusable;
            }
        }
    }

 
}
